<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/3/24 0024
 * Time: 17:45
 */

namespace app\admin\model;


use think\facade\Db;
use think\Model;

class Order extends Model
{
  public static function getOrderList($where){
      $order=Order::
          alias('o')
          ->field('o.status,o.*')
          ->field('s.order_status')
          ->field("p.payment_name")
          ->leftjoin('ecm_order_status s','o.status=s.status_id')
          ->leftjoin("ecm_payment p","o.payment_id=p.payment_id")
          ->where($where)
          ->paginate([

              'list_rows'=> 5,//每页数量

              'query' => request()->param(),

          ]);
      return $order;
  }
  public static function  getStatus(){
      $status=Order::suffix('_status')->select();
      return $status;


  }
}